CPP = g++
CFLAGS = -Wall
LFLAGS = -lm


.PHONY: all test clean

all: exp

exp:exp.o complex.o
	$(CPP) $(LFLAGS) -o $@ $^

exp.o:exp.cpp complex.hpp
	$(CPP) -c $(CFLAGS) -o $@ $<

complex.o:complex.cpp complex.hpp
	$(CPP) -c $(CFLAGS) -o $@ $<


test:tests
	./tests

tests:tests.o complex.o
	$(CPP) $(LFLAGS) -o $@ $^

tests.o:tests.cpp complex.hpp
	$(CPP) -c $(CFLAGS) -o $@ $<

clean:
	rm -f exp tests
	rm -f *.o
